package work.tools.deadline
{
	/**
	 * 期限生效经过时间 条件类 
	 * @author zhangfeng
	 * @see Deadline
	 * @see IQualification
	 */
	public class QualificationPassDay implements IQualification
	{
		private var _totalDay:uint
		/**
		 * 期限生效经过时间 条件类  
		 * @param total 期限生效经过时间
		 * 
		 */
		public function QualificationPassDay(total:uint=1)
		{
			_totalDay=total;
		}
		
		/**
		 * 期限生效经过时间 
		 * @return 
		 * 
		 */
		public function get totalDay():uint
		{
			return _totalDay;
		}

		public function set totalDay(value:uint):void
		{
			_totalDay = value;
		}

		/**
		 * @inheritDoc 
		 * 
		 */
		public function execute():Number
		{
			var date:Date=QualificationGroups.getInstance().startDate;
			var newDate:Date=new Date();
			var num:Number=(newDate.time-date.time)/86400000;
			return _totalDay-num;
		}
		
		/**
		 * @inheritDoc 
		 * 
		 */
		public function getClassName():String
		{
			return "QualificationPassDay";
		}
	}
}